package com.zmn.plat.manager.dictionary;


/**
 * 状态
 *
 * @author xiangjunming
 * @since 2019/08/06 17:42:44
 */
public enum StatusEnum {

    /**
     * values
     */
    DISABLE(1, "停用"),
    ENABLE(2, "启用"),
    ;

    private Integer code;
    private String name;

    StatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static StatusEnum of(Integer code) {
        switch (code) {
            case 1:
                return DISABLE;
            case 2:
                return ENABLE;
            default:
                return DISABLE;
        }
    }
}
